/**
 * crawler
 *
 * outlook@China software studio
 * Copyright (c) 2008-2010. All Rights Reserved.
 * http://www.outlook.com
 */

package org.outlook.crawler.util.parser;

import org.apache.commons.lang.builder.EqualsBuilder;

/**
 * function:
 * 
 * @author Watson email: watson.wu@hotmail.com
 * @date 2011
 */
public class LinkDim {

	private String url;
	private int start;
	private int end;

	public LinkDim() {
		super();
	}

	public LinkDim(String url, int start, int end) {
		super();
		this.url = url;
		this.start = start;
		this.end = end;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public int getStart() {
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public int getEnd() {
		return end;
	}

	public void setEnd(int end) {
		this.end = end;
	}

	@Override
	public boolean equals(Object obj) {
		if(super.equals(obj)) return true;
		if(obj instanceof LinkDim) {
			LinkDim object =(LinkDim)obj;
			return new EqualsBuilder().append(url, object.getUrl())
			.append(start, object.getStart())
			.append(end, object.getEnd()).isEquals();
		}
		return false;
	}

	@Override
	public String toString() {
		return new StringBuffer().append(url).append(", (").append(start).append(", ").append(end).append(")").toString();
	}

}
